package filters;
import java.util.*;

/**
 * The filter manager is the public gateway for the filters.
 * Use this manager to retrieve and handle filter operations.
 * @author Avi
 *
 */
public class FilterManager {
	
	ArrayList<String> _filters;
	
	public FilterManager() {
		_filters = new ArrayList<String>();
		_filters.add("FILE_WILDCARD");
		_filters.add("IS_READABLE");
	}
	
	public boolean checkFilterExistance(String filterName) throws UnsupportedFilterException {
		return(_filters.contains(filterName));
	}
	
	public Filter getFilterByName(String filterName) throws UnsupportedFilterException  { 
		if(filterName.compareTo("FILE_WILDCARD")==0) {
			return new FileWildCard(); 
		}
		if(filterName.compareTo("IS_READABLE")==0) {
			return new isReadableFilter(); 
		}
		
		throw new UnsupportedFilterException();
	}
			
}
